package top.hcode.hoj.dao.course;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.hcode.hoj.mapper.QuestionOptionMapper;
import top.hcode.hoj.pojo.entity.course.QuestionOption;

import java.util.List;

/**
 * @author orangej
 * @since 2024/12/18
 */
@Service
public class QuestionOptionDao extends ServiceImpl<QuestionOptionMapper, QuestionOption> {


    public List<QuestionOption> queryOptionsByQuestionId(Long questionId) {
        return list(new QueryWrapper<QuestionOption>()
                .eq("question_id", questionId)
                .orderByAsc("sort_order"));
    }

}
